﻿@model string
@{
    string YoutubeId = Model.Trim();
    if (YoutubeId.Contains("http://www.youtube.com/watch?v="))
    {
        YoutubeId = YoutubeId.Replace("http://www.youtube.com/watch?v=", "");
        if (YoutubeId.Contains("&")) { YoutubeId = YoutubeId.Remove(YoutubeId.IndexOf("&")); }
        <text>
            <object width='496' height='360'><param name='movie' value='http://www.youtube.com/v/@(YoutubeId)"?fs=1&amp;hl=iw_IL&amp;rel=0&amp;autoplay=1'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/@(YoutubeId)?fs=1&amp;hl=iw_IL&amp;rel=0&amp;autoplay=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='496' height='360'></embed></object>
        </text>
    }
}